public class LambdaTest {
    public static void main(String[] args) {
//        method(new Swim() {
//            @Override
//            public void swimming() {
//                System.out.println("游泳");
//            }
//        });

//        method(() -> {
//            System.out.println("游泳");
//        });

        method(() -> System.out.println("游泳"));
    }

    public static void method(Swim swim) {
        swim.swimming();
    }
}

@FunctionalInterface
interface Swim {
    public abstract void swimming();
}
